<%@page import="com.entity.UserInfo"%>
<%@page import="com.biz.ProTypeBizImpl"%>
<%@page import="com.entity.ProType"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'showProType.jsp' starting page</title>
    
	<meta charset="UTF-8">
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/showtable.css">
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	<script type="text/javascript">
		function delProType(delid){
			if(confirm("你确定要删除该类别吗")){
				location="admin/productType/do/doDelProType.jsp?id="+delid;
			}
		}
	</script>
  </head>
  <body>
  	<div class="main-body-div">
	  	<form action="#" method="post">
	  		<h2 class="table-title">商品类别列表</h2>
	  		<div class="title-link">
	  			<a href="admin/productType/addProType.jsp">增加商品类别</a>
	  		</div>
		    <table>
		    	<tr>
		    		<td>编号</td>
		    		<td>类别名</td>
		    		<td>创建人</td>
		    		<td>创建时间</td>
		    		<td>操作</td>
		    	</tr>
		    	<% 
		    		List<ProType> list=new ProTypeBizImpl().showProType();
		    		for(ProType pt:list){
		    	%>
		    		<tr>
			    		<td><%=pt.getId() %></td>
			    		<td><%=pt.getTname() %></td>
			    		<td><%=pt.getUname() %></td>
			    		<td><%=pt.getIntime() %></td>
			    		<td>
			    			<a href="javascript:delProType(<%=pt.getId()%>)">删除</a>
			    			&nbsp;&nbsp;|&nbsp;&nbsp;
			    			<a href="admin/productType/modProType.jsp?id=<%=pt.getId()%>">修改</a>
			    		</td>
			    	</tr>
		    	<%
		    		}
		    	%>
		    </table>
    	</form>
    </div>
  </body>
</html>
